package com.wayhome.srpingbootmybatis.drexamine.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wayhome.srpingbootmybatis.test.DateUtilTes;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@ApiModel(value = "记分登记备案状态上传DTO")
public class ImsScoreUploadDTO {

    @ApiModelProperty(value = "删除标志，1=是， 0=否")
    private Integer delFlag;

    @ApiModelProperty(value = "唯一编号")
    private String rid;

    @ApiModelProperty(value = "协议年度 YYYY")
    private String sttYear;

    @ApiModelProperty(value = "医药机构编码")
    private String fixmedinsCode;

    @ApiModelProperty(value = "医药机构名称")
    private String fixmedinsName;

    @ApiModelProperty(value = "医保支付资格人员类型  1=医保医师 2=医保护士 3=医保药学人员 4=医保技术人员 5=医保药师 6=其他")
    private Integer prfsPsnType;

    @ApiModelProperty(value = "人员名称")
    private String psnName;

    @ApiModelProperty(value = "证件类型")
    private String certType;

    @ApiModelProperty(value = "证件号码")
    private String certno;

    @ApiModelProperty(value = "签名标志")
    private Integer signFlag;

    @ApiModelProperty(value = "本次记分")
    private Integer crtRcdSco;

    @ApiModelProperty(value = "记前分数")
    private Integer nowSco;

    @ApiModelProperty(value = "记后分数")
    private Integer chgdSco;

    @ApiModelProperty(value = "记分规则")
    private Integer scoreSrc;

    @ApiModelProperty(value = "记分原因")
    private String scoRea;

    @ApiModelProperty(value = "处罚标志 1=是；0=否")
    private Integer punhFlag;

    @ApiModelProperty(value = "处罚情况")
    private String punhStas;

    @ApiModelProperty(value = "记分时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date scoDate;

    @ApiModelProperty(value = "登记状态  1=正常 2=暂停 3=终止")
    private String regStas;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "状态开始时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date begnDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "状态结束时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "状态变更时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updtDate;

    @ApiModelProperty(value = "经办人编号")
    private String opterNo;

    @ApiModelProperty(value = "经办人姓名")
    private String opter_Name;

    @ApiModelProperty(value = "归属经办机构编码")
    private String afilOptionsNo;

    @ApiModelProperty(value = "经办机构名称")
    private String optins_Name;

    @ApiModelProperty(value = "经办机构所属医保区划")
    private String admdvs;

    @ApiModelProperty(value = "人员管理码")
    private String psnMgtcode;

    //新增的传记分日期就行
    public void buildRid() {
        buildRid(scoDate);
    }

    //删除的要传原来的记分日期
    public void buildRid(Date date) {
        final String SPEARATOR = "_";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date2Str = simpleDateFormat.format(date);
        this.rid = sttYear + SPEARATOR + fixmedinsCode + SPEARATOR + prfsPsnType + SPEARATOR + psnMgtcode + SPEARATOR + certno + SPEARATOR + date2Str;
    }
}
